package OnJava8.reuse;

/**
 * @Auther DRevelation
 * @Date 2020-05-19 上午 11:01
 * @Desc
 */
public class FinalOverridingIllusion {
    public static void main(String[] args) {
        OverridingPrivate op = new OverridingPrivate();
        op.f();

        WithFinals wf = op;
        ((OverridingPrivate) wf).f();
    }
}

class WithFinals {
    private final void f() {
        System.out.println("WithFinal.f()");
    }
}

class OverridingPrivate extends WithFinals {
    protected final void f() {
        System.out.println("OverridingPrivate.f()");
    }
}